home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Shareware Grab Bag
/
Shareware Grab Bag.iso
/
007
/
boostrs.arc
/
WORDS.PAS
< prev
next >
Wrap
Pascal/Delphi Source File
|
1985-11-13
|
574b
|
23 lines
{ ---------------------------------------
WORDS returns the number of words in S.
--------------------------------------- }
Function Words ( S : AnyString ) : Integer;
var
NumWords, CurrentAddress, Len
: integer;
begin
S := strip(S,' ');
Len := Length(S);
if Len = 0 then
Words := 0
else
begin
NumWords := 1;
CurrentAddress := 1;
for CurrentAddress := 1 to Len do
if S[CurrentAddress] = #32 then
NumWords := NumWords + 1;
Words := NumWords;
end;
end { Words };